
# generate figure E2

# load packages
library(rio) # load data
library(tidyverse) # data manipulation
library(ggpubr) # combine different plots

# set working directory
setwd("~/replication_files/")

# call R file that estimates models 
source("05_generate_tab1.R")
# note that you need to change the working directory in the source file as well

plot7 <- plot(fect1, type = "calendar",  main = "(a) Treatment: Consultation Promotes Natural Resource Governance", 
              ylab = "Effect on the Probability of Policy Passage",
              xlab = "Year", ylim = c(-0.6,0.6)) + theme_classic() +
  theme(plot.title = element_text(face="bold")) + theme(plot.margin = margin(0.1,0.4,0.1,0.1, "cm"))

plot8 <- plot(fect2, type = "calendar",  main = "(b) Treatment: Consultation Uses Natural Resource Terms", 
              ylab = "Effect on the Probability of Policy Passage",
              xlab = "Year", ylim = c(-0.6,0.6)) + theme_classic() +
  theme(plot.title = element_text(face="bold")) + theme(plot.margin = margin(0.1,0.4,0.1,0.1, "cm"))

ggarrange(plot7,plot8, ncol = 2) %>%
  ggexport(filename = "figures/figE3.pdf", width = 14, height = 5)
